﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace numberOfCombinations
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(findingCombination(10));
            Console.ReadKey();
        }
        static int findingCombination(int numberOfSteps)
        {
            int numOfCombination = 0;
            if (numberOfSteps == 1) return 1;
            if (numberOfSteps == 0) return 0;
            int numberOfIterations;
            if (numberOfSteps % 2 == 0)
            {
                numberOfIterations = numberOfSteps / 2 - 1;
                int a = 1;
                for (int i = 0; i < numberOfIterations; i++)
                {
                    numOfCombination += numberOfSteps - a;
                    a = a + 2;
                }
                numOfCombination += 2;
            } 
            else
            {
                numberOfIterations = (numberOfSteps - 1) / 2 - 1;
                int a = 1;
                for (int i = 0; i < numberOfIterations; i++)
                {
                    numOfCombination += numberOfSteps - a;
                    a = a + 2;
                }
                numOfCombination += 3;
            }

            return numOfCombination; 
        }
    }
}
